
* helper program to eliminate leading 0 in student IDs in NYC
capture program drop eliminate_leading_0 
program define eliminate_leading_0
set trace on
capture confirm numeric variable student_id_scram

if _rc != 0 {
qui count if substr(student_id_scram,1,1) == "0"
		
		while r(N) {
			replace student_id_scram = substr(student_id_scram,2,.) if substr(student_id_scram,1,1) == "0"
			count if substr(student_id_scram, 1, 1) == "0"	
	
		}
	}
end 
